import 'package:seedfour/generated/json/base/json_field.dart';
import 'package:seedfour/generated/json/user_info_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class UserInfoEntity {
  String? uid;
  String? name;
  String? bossName;
  String? mobile;
  String? spareMobile;
  String? avatar;
  int? cashBalance;
  String? cashBalanceStr;
  String? marginAmountStr;
  int? userRole;
  UserInfoBank? bank;
  UserInfoEffect? effect;
  UserInfoTargetSite? targetSite;
  List<UserInfoPrivis>? privis;

  UserInfoEntity();

  factory UserInfoEntity.fromJson(Map<String, dynamic> json) =>
      $UserInfoEntityFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserInfoTargetSite {
  late String sysName = '';
  late String sysCn = '';
  late String owner = '';
  late String name = '师付';
  late String logo = '';

  UserInfoTargetSite();

  factory UserInfoTargetSite.fromJson(Map<String, dynamic> json) =>
      $UserInfoTargetSiteFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoTargetSiteToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserInfoPrivis {
  String? sysName;
  String? sysCn;
  String? owner;
  String? name;

  UserInfoPrivis();

  factory UserInfoPrivis.fromJson(Map<String, dynamic> json) =>
      $UserInfoPrivisFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoPrivisToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserInfoBank {
  String? withdrawAcct;
  String? withdrawBank;
  String? withdrawName;

  UserInfoBank();

  factory UserInfoBank.fromJson(Map<String, dynamic> json) =>
      $UserInfoBankFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoBankToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserInfoEffect {
  String? monthEffect;
  String? rtEffect;
  String? welfareEffect;

  UserInfoEffect();

  factory UserInfoEffect.fromJson(Map<String, dynamic> json) =>
      $UserInfoEffectFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoEffectToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
